from rest_framework import serializers

from goods.models import SPU, Brand, GoodsCategory


class SPUserializers(serializers.ModelSerializer):
    brand = serializers.StringRelatedField()
    brand_id = serializers.IntegerField()
    category1_id =serializers.IntegerField()
    category2_id =serializers.IntegerField()
    category3_id =serializers.IntegerField()
    class Meta:
        model = SPU
        exclude=['category1', 'category2', 'category3']

class BrandSimpleSerializers(serializers.ModelSerializer):
    class Meta:
        model = Brand
        fields='__all__'

class ChannelCategorySerializers(serializers.ModelSerializer):
    class Meta:
        model = GoodsCategory
        fields = '__all__'